package testing.checker;


import static org.junit.Assert.assertEquals;

import java.util.ArrayList;

import org.junit.Before;
import org.junit.Test;

import checker.ArrayChecker;

public class ArrayCheckerTest {
	ArrayChecker checker;
	ArrayList<String[]> original_array;
	ArrayList<String[]> compared_array;
	@Before
	public void setUp() throws Exception {
		this.original_array = new ArrayList<String[]>();
		this.compared_array = new ArrayList<String[]>();
		this.checker = new ArrayChecker();
	}
	@Test
	public void test1()
	{
		String []original1 = {"He","is","a","boy"};
		String []compare1 = {"He","is","a","boy"};
		original_array.add(original1);
		compared_array.add(compare1);
		checker.set_origin_arraylist(original_array);
		checker.set_compared_arraylist(compared_array);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,1);
		
	}
	@Test
	public void test2()
	{
		String []original1 = {"He","is","a","boy"};
		String []compare1 = {"He","is","a","boys"};
		original_array.add(original1);
		compared_array.add(compare1);
		checker.set_origin_arraylist(original_array);
		checker.set_compared_arraylist(compared_array);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,0);
		
	}
	@Test
	public void test3()
	{
		String []original1 = {"He","is","a","boy"};
		String []original2 = {"I","am","man"};
		String []compare1 = {"He","is","a","boy"};
		String []compare2 = {"I","am","man"};
		original_array.add(original1);
		original_array.add(original2);
		compared_array.add(compare1);
		compared_array.add(compare2);
		checker.set_origin_arraylist(original_array);
		checker.set_compared_arraylist(compared_array);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,2);
		
	}
	@Test
	public void test4()
	{
		String []original1 = {"He","is","a","boy"};
		String []original2 = {"I","am","mans"};
		String []compare1 = {"He","is","a","boys"};
		String []compare2 = {"I","am","man"};
		original_array.add(original1);
		original_array.add(original2);
		compared_array.add(compare1);
		compared_array.add(compare2);
		checker.set_origin_arraylist(original_array);
		checker.set_compared_arraylist(compared_array);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,0);
		
	}
	@Test
	public void test5()
	{
		String []original1 = {"He","is","a","boys"};
		String []original2 = {"I","am","mans"};
		String []compare1 = {"He","is","a","boys"};
		String []compare2 = {"I","am","man"};
		original_array.add(original1);
		original_array.add(original2);
		compared_array.add(compare1);
		compared_array.add(compare2);
		checker.set_origin_arraylist(original_array);
		checker.set_compared_arraylist(compared_array);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,1);
		
	}

}
